import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createRouter, createWebHistory } from 'vue-router'
import './style.css'
import App from './App.vue'

// 路由配置
const routes = [
  {
    path: '/',
    redirect: '/transactions'
  },
  {
    path: '/transactions',
    name: 'Transactions',
    component: () => import('./views/TransactionsView.vue')
  },
  {
    path: '/rules',
    name: 'Rules',
    component: () => import('./views/RulesView.vue')
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

// 创建应用
const app = createApp(App)

// 安装插件
app.use(createPinia())
app.use(router)

// 挂载应用
app.mount('#app')
